#pragma once


#include "CCoverageIntervalBuffer.h"
class CActiveEdge;


class CCoverageBuffer
{
public: 
	void Initialize();
	void Destroy();
	void Reset();
	HRESULT FillEdgesAlternating(const CActiveEdge * pEdgeActiveList, XINT32 nSubpixelYCurrent);
	HRESULT FillEdgesAlternatingClipped(const CActiveEdge * pEdgeActiveList, XINT32 nSubpixelYCurrent);
	HRESULT FillEdgesWinding(const CActiveEdge * pEdgeActiveList, XINT32 nSubpixelYCurrent);
	HRESULT FillEdgesWindingClipped(const CActiveEdge * pEdgeActiveList, XINT32 nSubpixelYCurrent);
private: 
	HRESULT Grow(struct CCoverageInterval * * ppIntervalNew, struct CCoverageInterval * * ppIntervalEndMinus4);
public: 
	struct CCoverageInterval * m_pIntervalStart;
	struct CCoverageInterval * m_pIntervalLastIntervalEnd;
	XINT32 m_clipCount;
private: 
	struct CCoverageInterval * m_pIntervalNew;
	struct CCoverageInterval * m_pIntervalEndMinus4;
	struct CCoverageIntervalBuffer m_pIntervalBufferBuiltin;
	struct CCoverageIntervalBuffer * m_pIntervalBufferCurrent;
};